/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.muni.fi.pa165.ddtroops.serviceinterfaces;

import cz.muni.fi.pa165.ddtroops.dto.HeroDTO;
import cz.muni.fi.pa165.ddtroops.dto.SquadDTO;
import java.util.List;

/**
 *
 * @author Erik
 */
public interface SquadService {


    /**
     * Method creates new Squad object.
     * @param name new squad name.
     * @param description new squad description.
     * @param leader new squad leader.
     * @return new squad.
     */
    SquadDTO createNewSquad(String name, String description, HeroDTO leader);

    /**
     * Method creates new Squad from Squad object.
     * @param squad instance of class Squad to be created
     * @throws DataAccessException in case of any exception on a persistence layer
     */
    void create(SquadDTO squad);

    /**
     * Method update updates state of given Squad.
     * @param squad instance of class Squad to be updated
     * @throws DataAccessException in case of any exception on a persistence layer
     */
    void update(SquadDTO squad);

    /**
     * Method delete deletes given Squad.
     * @param squad instance of class Squad to be removed
     * @throws DataAccessException in case of any exception on a persistence layer
     */
    void delete(SquadDTO squad);

    /**
     * Method getByName retrieves Squad with specified name
     * @param name name of Squad
     * @return instance of class Squad with specified name
     * @throws DataAccessException in case of any exception on a persistence layer
     */
    SquadDTO getByName(String name);

    /**
     * Method getById retrieves Squad with specified id
     * @param id id of Squad
     * @return instance of class Squad with specified id
     * @throws DataAccessException in case of any exception on a persistence layer
     */
    SquadDTO getById(Long id);

    /**
     * Method getAll fetches all the Squads.
     * @return list of instances of class Squad
     * @throws DataAccessException in case of any exception on a persistence layer
     */
    List<SquadDTO> getAll();

    /**
     * Method retreives squad in which is Hero present.
     * @param hero
     * @return
     */
    SquadDTO getSquadOfHero(HeroDTO hero);

}
